﻿using Xtensive.Orm;
using Xtensive.Orm.Model;

namespace SingleTable.Model
{
    [HierarchyRoot(InheritanceSchema = InheritanceSchema.SingleTable)]
    public abstract class Beverage : Entity
    {
        [Field, Key]
        public int Id { get; private set; }

        [Field]
        public string Name { get; set; }

        protected Beverage(Session session) :
            base(session) {}
    }

    public class SoftDrink : Beverage
    {
        [Field]
        public bool IsCarbohydrated { get; set; }

        [Field]
        public string Sweetener { get; set; }

        public SoftDrink(Session session) : base(session)
        {}
    }

    public class AlcoholicBeverage : Beverage
    {
        [Field]
        public decimal AlcoholContent { get; set; }

        public AlcoholicBeverage(Session session) : base(session)
        {}
    }
}